package org.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName vacation_balance
 */
@TableName(value ="vacation_balance")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class VacationBalance {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer balanceId;

    /**
     * 
     */
    private Integer userId;

    /**
     * 
     */
    private BigDecimal vacationDays;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitAt;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        VacationBalance other = (VacationBalance) that;
        return (this.getBalanceId() == null ? other.getBalanceId() == null : this.getBalanceId().equals(other.getBalanceId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getVacationDays() == null ? other.getVacationDays() == null : this.getVacationDays().equals(other.getVacationDays()))
            && (this.getSubmitAt() == null ? other.getSubmitAt() == null : this.getSubmitAt().equals(other.getSubmitAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBalanceId() == null) ? 0 : getBalanceId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getVacationDays() == null) ? 0 : getVacationDays().hashCode());
        result = prime * result + ((getSubmitAt() == null) ? 0 : getSubmitAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", balanceId=").append(balanceId);
        sb.append(", userId=").append(userId);
        sb.append(", vacationDays=").append(vacationDays);
        sb.append(", submitAt=").append(submitAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append("]");
        return sb.toString();
    }
}